package com.nowcoder.community.b_dao;


import com.nowcoder.community.a_entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CommentMapper {//错1：mapper是接口！-xml
    List<Comment> selectCommentsByEntity(@Param("entityType") int entityType, @Param("entityId")  int entityId, @Param("offset") int offset, @Param("limit") int limit);

    //插评论
    void insertComment(Comment comment);


    //（工具）查评论数给 postMapper帖子更新用 + 帖子post更新count字段用
    int selectCountByEntity(@Param("entityType")int entityType,
                            @Param("entityId")int entityId);

    //kafka用
    Comment selectCommentById(@Param("id") int id);
}
